<template>
<!-- CABG -->
    <div >
        <div class="header">
            <image :src="titleleftimg" class="header-left-img" @click="pageControl.finish()"/>
            <div class="header-center"><text class="header-text">CABG</text></div>
            <div class="header-right" @click="pageControl.saveData()"><text class="header-right-text">保存</text></div>
        </div>
        <list>                  
            <cell>
                <div class="content">
                    <div class="box">
                        <div class="line">
                            <div class="title"><text class="box-text">决定CABG时间:</text></div>     
                            <div class="input" @click="pageControl.selectedDateTime(0,DiagTreatModel.DECISION_CABG_TIME)">
                                <text class="input-text">{{DiagTreatModel.DECISION_CABG_TIME | filterTime}}</text>
                                <image :src="imgUrl" class="img-unit"></image>
                            </div>                       
                        </div>
                        <div class="line"> 
                            <div class="title"><text class="box-text">开始CABG时间:</text></div>     
                            <div class="input"  @click="pageControl.selectedDateTime(1,DiagTreatModel.START_CABG_TIME)">
                                <text class="input-text">{{DiagTreatModel.START_CABG_TIME | filterTime}}</text>
                                <image :src="imgUrl" class="img-unit"></image>
                            </div>                       
                        </div>
                    </div> 
                    <div class="box">                            
                        <div class="line">                    
                            <div class="title"><text class="box-text">CABG结束时间:</text></div>     
                            <div class="input" @click="pageControl.selectedDateTime(2,DiagTreatModel.END_CABG_TIME)">
                                <text class="input-text">{{DiagTreatModel.END_CABG_TIME | filterTime}}</text>
                                <image :src="imgUrl" class="img-unit"></image>
                            </div>                       
                        </div>  
                        <div class="line"></div>                    
                    </div>                    
                </div>
            </cell>
        </list>       
    </div>
</template>
<script>
    import EMNewMainCABGControl from "./EMNewMainCABGControl";
    import DateUtil from "../../common/util/DateUtil"
    import Resource from "../../../dist/res/Resource";
    export default {
        name: 'EMNewMainEditInfo',
        data: function () {            
            return {
                titleleftimg:Resource.getResource("title_cha_img.png"),
                pageControl:"",
                DiagTreatModel: {
                    DECISION_CABG_TIME: '',
                    START_CABG_TIME: '',
                    END_CABG_TIME: ''
                }
            }                                                     
        },
        filters: {
            filterTime: function(item) {
                if(item) {
                    let time = DateUtil.formatTime(item,'yyyy-MM-dd hh:mm')
                    return time
                }
            }
        },
        mounted:function () {
            let self = this;
            self.pageControl = new EMNewMainCABGControl(self);
        }
    }
</script>
<style>
    .header {
        height: 40px;
        background-color: #FFF;
        display: flex;
        flex-direction: row;
        justify-content: space-between;    
        align-items: center;
        border-bottom-style: solid;
        border-bottom-width: 0.5px;
        border-bottom-color: #f2f2f2;
    }
    .header-left {
        margin-left: 20px;
    }
    .header-left-img {
        width: 30px;
        height: 30px;
        margin-left: 10px;
    }
    .header-right {
        width: 80px;
        height: 25px;
        background-color: #4c7fd8;
        margin-right: 20px;  
        border-radius: 2px;     
    }
    .header-text {
        font-size: 13px;
        color: #666;
    }
    .header-right-text {
        font-size: 13px;
        color: #FFF;
        text-align: center;
        line-height: 25px;       
    }
    .banner-tab {  
        width: 760px;      
        height: 30px;
        display: flex;
        flex-direction: row;
        align-items: center;
        border-bottom-style: solid;
        border-bottom-width: 1px;
        border-bottom-color: #f2f2f2;
        padding-left: 5px;
        padding-right: 5px;
              
    }
    .tab {
        width: 80px;
        height: 30px;
        display: flex;
        justify-content: center; 
        margin-left: 5px;
        margin-right: 5px;
    }
    .tab-text {
        text-align: center;
        font-size: 12px;
        color: #666;
    }
    .tab-active {
        border-bottom-style: solid;
        border-bottom-width: 1px;
        border-bottom-color: #4c7fd8;
    }
    .content {
        padding-left: 40px;
        padding-right: 40px;
        padding-top: 20px;
        padding-bottom: 20px;
        box-sizing: border-box;
    }
    .box {
        flex: 1;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;   
        height: 40px;
        align-items: center;
    }   
    .box-text {
        font-size: 12px;
        color: #666;
    }
    .line {
        flex: 1;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        box-sizing: border-box;
        margin-right: 70px;
    }    
    .title {
        width: 100px;
    }    
    .input {
        position: relative;
        flex: 1;
        box-sizing: border-box;
        padding-left: 8px;
        height: 25px;       
        border-radius: 5px;
        border-style: solid;
        border-width: 1px;
        border-color: #b1b1b1;
    }
    .input-text {  
        color: #666;
        line-height: 22px;     
        font-size: 12px;
    }                   
    .img-unit {
        position: absolute;                  
        top: 3px;
        right: 8px;
        width: 10px;
        height: 19px;
    }
</style>

